
package com.joysuch.wwyt.datadump.biz.convertor;

import cn.zlg.common.datadump.annotation.DataDumpField;
import cn.zlg.common.datadump.convertor.FieldValueConvert;
import org.springframework.stereotype.Component;

@Component
public class ImportMhChemProudctProductTypeConvertor implements FieldValueConvert<String, Long> {

    @Override
    public Long convert(Object bean, String value, DataDumpField dataField) {
        if(value == null) {
            return null;
        }
        switch (value) {
            case "产品": return 1L;
            case "中间产品": return 2L;
            case "进口化学品": return 3L;
            case "原料": return 4L;
        }
        return null;
    }

}
